package com.dys.exceptionhandler;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

/**
 * @className: com.dys.exceptionhandler.GlobalExceptionHandler1
 * @description: com.dys.exceptionhandler
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/11/01 21:16
 */
// @ControllerAdvice
public class GlobalExceptionHandler1 {

    @ExceptionHandler(value = {ArithmeticException.class, NullPointerException.class})
    public ModelAndView handleGlobalException() {
        ModelAndView mv = new ModelAndView();
        mv.setViewName("err1.jsp");
        return mv;
    }
}
